package testIntergration;


import static org.junit.Assert.assertEquals;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import FamilyTherapy.Game;
import FamilyTherapy.GCWindow;
import FamilyTherapy.Player;

public class testGame_startGame {

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testStartGame() {
		
		Player[] p ={new Player("a",1),new Player("b",2)};
		Game game = new Game();
		
		class GCWindowStub extends GCWindow{
			@Override
			public void displayAllInfo(Player p[])
			{

			}
		}
		GCWindow gwindow = new GCWindowStub();
		/////output
		final ByteArrayOutputStream outContent = new ByteArrayOutputStream();
		System.setOut(new PrintStream(outContent));
		
		
		game.startGame(gwindow, p);
		
		String expected = "Game start!!!\n";
			
		assertEquals(expected,outContent.toString());

	}
}
